package com.wise.service.cms.content.product;

import com.wise.entities.content.Product;
import com.wise.framework.daomodel.DaoOne4Update;
import com.wise.framework.daomodel.DaoRemove;
import com.wise.summer.v1.cms.content.product.DeleteProductById;
import org.springframework.stereotype.Service;
import org.summerframework.model.SummerService;
import org.summerframework.model.SummerServiceBean;

import static com.wise.model.content.ContentErrMsgs.Err_001000250009;

/**
 * @author shaoming
 * @date 2019-09-09
 */
@Service
@SummerService
public class DeleteProductByIdService implements SummerServiceBean<DeleteProductById> {

	@Override
	public void sum(DeleteProductById summer) {
		Product product = DaoOne4Update.s(Product.class, summer.getId(), Err_001000250009);

		DaoRemove.s(product);
		summer.setSummerResult(Boolean.TRUE);
	}
}
